﻿using System.Collections.Generic;
using System.Linq;
using EnetaMvc.ApplicationServices.Dto;
using EnetaMvc.Infrastructure;

namespace EnetaMvc.Web.Models
{
    public class EventListModel
    {
        public PagedResult<EventListDto> Events { get; set; }
        public IList<EventAttendeeDto> Attendings { get; set; }

        public EventListModel()
        {
            Attendings = new List<EventAttendeeDto>();
        }

        public bool ContainsEventId(long eventId)
        {
            return Attendings.FirstOrDefault(a => a.EventId == eventId) != null;
        }
    }
}